package com.dolojia.javafxboot.ctrl;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class XmlToObjectCodeCtrl {

    @FXML
    private TextArea textArea1;
    @FXML
    private TextArea textArea2;
    @FXML
    private TextArea textArea3;
    @FXML
    private TextArea textArea4;

    public void xmlToCodeOnAction(ActionEvent actionEvent) throws Exception {
        log.info("XmlToObjectCodeCtrl#xmlToCodeOnAction");
        String[] string = JavaFxXmlToObjectCodeService.xmlToCode(textArea1.getText());
        log.info("string: {}", textArea1.getText());
        textArea2.setText(string[0]);
        textArea3.setText(string[1]);
        textArea4.setText(string[2]);
    }
}
